#include <iostream>
#include <mysql/mysql.h>
#include <string.h>
#include "connect.cpp"

//insert
int main(){
    MYSQL conn;
    conn = my_connect();

    std::string insertSql = "insert into user (`name`, `age`) values ('xiaoming中文', 10)";
    int res = mysql_query(&conn, (char*)insertSql.c_str());
    if(res){
        printf("Query failed (%s)\n", mysql_error(&conn));
    }else{
        std::cout << "insert success" << std::endl;
    }

    mysql_close(&conn);
    return 0;
}